package cn.stylefeng.guns.modular.agv.controller;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.agv.entity.RoadWayListRsVo;
import cn.stylefeng.guns.modular.agv.model.params.RoadWayListParam;
import cn.stylefeng.guns.modular.agv.service.HikAgvRoadWayService;
import cn.stylefeng.guns.sys.modular.system.service.UserService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;


/**
 * 海康AGV任务单控制器
 *
 * @author zhangzh
 * @Date 2024-06-06 09:51:55
 */
@Controller
@RequestMapping("/biTuskRoadWayList")
public class BiTuskRoadWayListController extends BaseController {

    private String PREFIX = "/bi/biTuskRoadWayList";

    @Autowired
    private HikAgvRoadWayService hikAgvRoadWayService;

    @Autowired
    private UserService userService;

    /**
     * 跳转到主页面
     *
     * @author zhangzh
     * @Date 2024-06-06
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "/biTuskRoadWayList.html";
    }

    /**
     *
     * @param param
     * @return
     */
    @ResponseBody
    @RequestMapping("/listAll")
    public LayuiPageInfo listAll(RoadWayListParam param) {
        //StorageRsVo mapStorage = TustApiUtils.getMapStorage(tuskBaseUrl);
        List<Map<String, RoadWayListRsVo>> list = hikAgvRoadWayService.tuskRoadWayList(param);
        LayuiPageInfo layuiPageInfo = new LayuiPageInfo();
        layuiPageInfo.setData(list);
        layuiPageInfo.setCount(list.size());
        return layuiPageInfo;
    }

}


